﻿@using KRM.Core.Library
@{
    var result = StaticVariables.UrlResult;
}

@if (result != null)
{
    if (result.IsReload == true)
    {
    <script>
        window.opener.location.reload();
    </script>
    }
    if (!string.IsNullOrEmpty(result.JavaScript))
    {
    <script>
        @Html.Raw(result.JavaScript)
    </script>
    }
    switch (result.IsSuccess)
    {
        case true:
    <div class="alert alert-success alert-dismissable">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>Success!</strong> @Html.Raw(result.Message)
    </div>
            break;
        case false:
    <div class="alert alert-error alert-dismissable">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>Error!</strong> @Html.Raw(result.Message)
    </div>
            break;
    }
    StaticVariables.UrlResult = null;
}